package lambda;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.function.Consumer;

public class ConsumerTest {
    public static void main(String[] args) {


        String[] arr = {"asdf,30", "fff,39"};

      getDetail(arr , s -> {
          String[] split = s.split(",");
          System.out.print("name:"+split[0]);
      },s -> {
          String[] split = s.split(",");
          System.out.println("  age:"+split[1]);
      });

    }

    private static void getDetail(String[] arr, Consumer<String> con1, Consumer<String> con2) {

        for (String s : arr
        ) {
            con1.andThen(con2).accept(s);
        }

    }
}
